<template>
    <el-button text @click="dialogVisible = true">
        click to open the Dialog
    </el-button>

    <el-dialog
            v-model="dialogVisible"
            title="资源索引"
            width="30%"
            :before-close="handleClose"
    >
        <div class="list">
            <el-table :data="tableData" style="width: 100%">
                <el-table-column prop="courseId" label="课程ID" width="100"/>
                <el-table-column prop="courseName" label="课程名称" width="150"/>
                <el-table-column prop="teacherName" label="教师名称"/>
            </el-table>

            <div class="example-pagination-block page">
                <el-pagination  background small layout="prev, pager, next" />
            </div>
        </div>
        <template #footer>
          <span class="dialog-footer">
            <el-button @click="dialogVisible = false">Cancel</el-button>
            <el-button type="primary" @click="dialogVisible = false">
              Confirm
            </el-button>
          </span>
        </template>
    </el-dialog>
</template>

<script>
import {ElMessageBox} from 'element-plus'

export default {
    name: "ResourceDialog",
    data() {
        return {
            dialogVisible: true,
            tableData: [
                {
                    date: '2016-05-03',
                    name: 'Tom',
                    address: '正在开发',
                },
                {
                    date: '2016-05-02',
                    name: 'Tom',
                    address: '正在开发',
                },
                {
                    date: '2016-05-04',
                    name: 'Tom',
                    address: '正在开发',
                },
                {
                    date: '2016-05-01',
                    name: 'Tom',
                    address: '正在开发',
                },
            ]
        }
    }
}
</script>

<style scoped>
.dialog-footer button:first-child {
    margin-right: 10px;
}
</style>